package com.innoking.docsys.doc.service.impl;

import com.innoking.docsys.doc.dto.UpmsUser;
import com.innoking.docsys.doc.feign.UserRestInterface;
import com.innoking.docsys.doc.service.UserService;
import com.innoking.docsys.user.module.UpmsUserVO;
import com.innoking.docsys.utils.JsonToOtherUtil;
import com.innoking.docsys.utils.OtherPojo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceimpl implements UserService {



    @Autowired
    UserRestInterface userRestInterface;
    @Override
    public UpmsUser getUserbyId(Integer id) {


        UpmsUserVO vo=new UpmsUserVO();
        vo.setUserId(id.longValue() );
        String paramJson=JsonToOtherUtil.parseObj2RestParam(vo);
        String  res=userRestInterface.getUserbyId( paramJson);
        OtherPojo obres = JsonToOtherUtil.rtOtherPojo(res, new UpmsUser() );
        UpmsUser user=(UpmsUser)obres.getObj();

        return user;
    }
}